package ca.ericslandry.client.widget;

import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;

public class CountDisplay extends DecoratorPanel {
	public CountDisplay(int number, String caption) {
		FlexTable table = new FlexTable();
		HTML voteCount = new HTML(String.valueOf(number));
		voteCount.setStyleName("bigFont");
		table.setWidget(0, 0, voteCount);
		table.setWidget(1, 0, new HTML(caption));
		table.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);
		table.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER);
		this.add(table);
	}
}
